#include "mainwindow.h"

#include <QApplication>
#include <QSplashScreen>
#include <QPixmap>
#include <QTimer>

int main(int argc, char *argv[])
{
    //控制缩放质量
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);

    QApplication app(argc, argv);

    QPixmap pic(":/img/start.jpg");
    QSplashScreen splashScreen(pic);
    splashScreen.show();
    QTimer::singleShot(3000, &splashScreen, &QSplashScreen::close);
    app.processEvents();

    MainWindow w;
    QIcon icon("://icons/img/snake.png");
    w.setWindowIcon(icon);
//    w.show();
//    splashScreen.finish(&w);

    QTimer::singleShot(3000, &w, &MainWindow::showHome);

    return app.exec();
}
